package cn.iocoder.yudao.module.trade.api.drainage.dto;

import lombok.Data;

@Data
public class CachePostOrderCountDto {

    private String drainageCode;
    private long orderCount;
    private long postCount;

    public CachePostOrderCountDto() {}

    public CachePostOrderCountDto(String drainageCode) {
        this.drainageCode = drainageCode;
        this.orderCount = 0;
        this.postCount = 0;
    }

    public Integer getPercent() {
        return Double.valueOf(Math.floor(this.postCount * 100d / this.orderCount)).intValue();
    }

    @Override
    public String toString() {
        return String.format("drainageCode: %s, orderCount:%d, postCount: %d", drainageCode, orderCount, postCount);
    }

}
